package com.example.controller;

import com.example.po.Patientcosts;
import com.example.service.PatientcostsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/patientscost")
@RestController
public class PatientscostController {
    @Autowired
    private PatientcostsService patientcostsService;

    @RequestMapping("/addbatch")
    public Boolean addbatch(@RequestBody List<Patientcosts> list){
        list.forEach(item->{
            item.setPaytime(new java.util.Date());
        });
        return patientcostsService.saveBatch(list);
    }
}
